babl_parse_double: permit 0 and 9 after .
authorØyvind Kolås <pippin@gimp.org>
Sun, 21 Jun 2015 20:25:41 +0000 (22:25 +0200)
committerØyvind Kolås <pippin@gimp.org>
Sun, 21 Jun 2015 20:26:25 +0000 (22:26 +0200)
spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not
possible.

babl/babl-internal.h

index eb80dd02652987746c9c2c05d4043166361df9dc..ef5411f997ca06a05815dbd83d5338485968a56e 100644 (file)
@@ -305,7 +305,7 @@ static inline double babl_parse_double (const char *str)
   {
     char *p = strchr (str, '.') + 1;
     double d = 10;
-    for (;*p && *p > '0' && *p < '9';p++, d *= 10)
+    for (;*p && *p >= '0' && *p <= '9';p++, d *= 10)
     {
       if (result >= 0)
         result += (*p - '0') / d;